#!/usr/bin/python3
# -*- codiing:utf-8 -*-
"""
assert
ssert的意思是，表达式n != 0应该是True，否则，根据程序运行的逻辑，后面的代码肯定会出错。

如果断言失败，assert语句本身就会抛出AssertionError
"""


def foo(s):
    n = int(s)
    assert n != 0, 'n is Zero!'   # 发生异常: AssertionError  n is Zero!
    return 10 / n


def main():
    foo('0')


if __name__ == "__main__":
    main()
